package controller.admin;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

/**
 * 管理员后台退出
 */
@WebServlet(name = "AdminUserLogoutServlet", value = "/admin/user_logout")
public class AdminUserLogoutServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //写过一个退出登录了接口的直接重定向过去
        String path = request.getContextPath();
        response.sendRedirect(path + "/user_logout");
    }
}
